package fnord.illuminati.action.actions;

import fnord.illuminati.action.AttackModifierAction;
import fnord.illuminati.card.Alignment;
import fnord.illuminati.order.AttackOrder;
import fnord.illuminati.order.AttackType;

public class DiscordianSocietyAction implements AttackModifierAction {
	private static final long serialVersionUID = 5166222886075204696L;

	@Override
	public int doAttack(AttackOrder order) {
		if (order.getAttackType()==AttackType.CONTROL) {
			for (Alignment a:order.getTo().getAlignments()) {
				if (a == Alignment.WEIRD)
					return 4;
			}
			return 0;
		}
		else
			return 0;
	}
	
	@Override
	public int doDefend(AttackOrder order) {
		for (Alignment a:order.getFrom().getAlignments()) {
			if (a == Alignment.GOVERNMENT || a == Alignment.STRAIGHT)
				return Integer.MIN_VALUE/2;
		}
		return 0;
	}
}
